package com.example.demo.service.impl;

import com.example.demo.dto.HealthDTO;
import com.example.demo.entity.BedType;
import com.example.demo.entity.Health;
import com.example.demo.entity.Nation;
import com.example.demo.entity.OldMan;
import com.example.demo.mapper.OldManMapper;
import com.example.demo.service.OldManService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OldManServiceImpl implements OldManService {

    @Autowired
    private OldManMapper oldManMapper;

    @Override
    public int addOldman(Map<String, String> map) {
        return oldManMapper.addOldman(map);
    }

    @Override
    public int updateOldman(Map<String, String> map) {
        return oldManMapper.updateOldman(map);
    }

    @Override
    public List<BedType> findBedType() {
        return oldManMapper.findBedType();
    }

    @Override
    public List<Nation> findNationType() {
        return oldManMapper.findNationType();
    }

    @Override
    public int addHealth(Map<String, String> map) {
        return oldManMapper.addHealth(map);
    }

    @Override
    public List<HealthDTO> findAllHealth(Integer startNum, Integer rows) {
        return oldManMapper.showToPage(startNum,rows);
    }

    @Override
    public List<HealthDTO> showToPage(Integer startNum, Integer rows) {
        return oldManMapper.showToPage(startNum,rows);
    }

    @Override
    public int findTotal() {
        return oldManMapper.findTotal();
    }

    @Override
    public int updateHealth(Map<String, String> map) {
        return oldManMapper.updateHealth(map);
    }

    @Override
    public int delHealthById(Integer hid) {
        return oldManMapper.delHealthById(hid);
    }

    @Override
    public List<OldMan> findAllOldman() {
        return oldManMapper.findAllOldman();
    }

    @Override
    public List<OldMan> search(String val) {
        return oldManMapper.search(val);
    }


}
